package com.otp.model.test.template;

// Generated Apr 8, 2012 1:27:28 PM by Hibernate Tools 3.4.0.CR1

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.appfuse.model.BaseObject;

/**
 * ResponseScoreOption generated by hbm2java
 */
@Entity
@Table(name = "response_options")
public class ResponseScoreOption extends BaseObject implements Serializable{

	private static final long serialVersionUID = 1L;
	private int objectId;
	private String name;
	private String description;
	private ResponseScoreRange responseRange;
	private Integer orderInRange;
	private Double score;
	private Double difficultyThreshold;
	private String extId;
	
	public ResponseScoreOption() {
	}

	public ResponseScoreOption(int objectId) {
		this.objectId = objectId;
	}

	public ResponseScoreOption(int objectId, String name, String description,
			Integer orderInRange, Double score) {
		this.objectId = objectId;
		this.name = name;
		this.description = description;
		this.orderInRange = orderInRange;
		this.score = score;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "object_id", unique = true, nullable = false)
	public int getObjectId() {
		return this.objectId;
	}

	public void setObjectId(int objectId) {
		this.objectId = objectId;
	}

	@Column(name = "name")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "description")
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "fk2response_range")
	public ResponseScoreRange getResponseRange() {
		return responseRange;
	}

	public void setResponseRange(ResponseScoreRange responseRange) {
		this.responseRange = responseRange;
	}
	
	@Column(name = "order_in_range")
	public Integer getOrderInRange() {
		return this.orderInRange;
	}

	public void setOrderInRange(Integer orderInRange) {
		this.orderInRange = orderInRange;
	}

	@Column(name = "score")
	public Double getScore() {
		return this.score;
	}

	public void setScore(Double score) {
		this.score = score;
	}
	
	@Column(name = "difficulty_polyt_thresh")
	public Double getDifficultyThreshold() {
		return this.difficultyThreshold;
	}

	public void setDifficultyThreshold(Double threshold) {
		this.difficultyThreshold = threshold;
	}
	
	@Column(name = "ext_id")
	public String getExtId() {
		return extId;
	}

	public void setExtId(String extId) {
		this.extId = extId;
	}


	@Override
	public boolean equals(Object o) {
		if (this == o) {
            return true;
        }
        if (!(o instanceof ResponseScoreOption)) {
            return false;
        }

        final ResponseScoreOption responseOption = (ResponseScoreOption) o;

        return objectId == responseOption.objectId;
	}

	@Override
	public int hashCode() {
		return objectId;
	}

	@Override
	public String toString() {
		return name;
	}

}
